<template>
  <div class="tour">
    <div class="nav">
      <p class="title">我的旅行</p>
      <div class="tour-nav">
        <p :class="selectIndex === 0 ? 'active' : ''" @click="selectIndex = 0">
          最近预定
        </p>
        <p :class="selectIndex === 1 ? 'active' : ''" @click="selectIndex = 1">
          已完成
        </p>
        <p :class="selectIndex === 2 ? 'active' : ''" @click="selectIndex = 2">
          喜欢
        </p>
      </div>
    </div>
    <div class="place i" v-show="selectIndex === 0">
      <div
        class="place-text"
        v-for="item in 5"
        :key="item * Math.random() * 999999"
      >
        <p class="place-date">12 3月 - 22 3月, 1间 - 2人</p>
        <div class="place-one">
          <img src="../assets/images/7.png" alt="" />
          <div class="name-price">
            <p class="name">吉野家民宿</p>
            <p class="price">￥1080</p>
          </div>
          <div class="a-address">
            <div class="address">
              吧塞罗那,西班牙
              <span><i class="fa fa-bolt"></i> 距离2km</span>
            </div>
            <p class="evening">/每晚</p>
          </div>
          <div style="clear:both;"></div>
          <div class="place-bottom">
            <van-rate class="star" :size="14" v-model="value" color="#13c2c2" />
            <p class="comments">80&nbsp;条评论</p>
          </div>
        </div>
      </div>
      <div style="height: 3rem"></div>
    </div>
    <div class="i" v-show="selectIndex === 1">
      <p>已完成</p>
    </div>
    <div class="i" v-show="selectIndex === 2">
      <div class="like" v-for="item in 5" :key="item">
        <div class="pic">
          <img src="../assets/images/7.png" alt="" />
        </div>
        <div class="like-text">
          <p class="like-name">奥迪酒店</p>
          <p class="like-address">巴黎,法国</p>
          <div class="like-address-t">
            <div class="address"><i class="fa fa-bolt"></i> 距离2km</div>
            <p class="like-price">￥5480</p>
          </div>
          <div class="like-bottom">
            <van-rate class="star" :size="14" v-model="value" color="#13c2c2" />
            <p class="evening">/每晚</p>
          </div>
        </div>
      </div>
      <div style="height: 3rem"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Tour",
  data() {
    return {
      value: 4,
      selectIndex: 0,
    };
  },
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.tour {
  display: flex;
  height: 100vh;
  flex-direction: column;
}
.nav {
  position: fixed;
  width: 100%;
  min-height: 7rem;
  top: 0;
  left: 0;
  background-color: #fff;
  z-index: 5;
}
.title {
  font-size: 1.2rem;
  color: #404040;
  margin: 0.8rem 0 1rem 1rem;
}
.tour-nav {
  width: 90%;
  height: 2.6rem;
  margin: 0 auto;
  border-radius: 1.4rem;
  text-align: center;
  background-color: #f5f5f5;
}
.active {
  color: #13c2c2;
}
.tour-nav p {
  width: 33%;
  margin: 0 auoto;
  float: left;
  font-size: 0.8rem;
  line-height: 2.6rem;
}
.i {
  margin-top: 7rem;
  padding: 0 1.6rem 0;
}
.place {
  width: 100%;
  flex: 1;
  overflow-y: scroll;
}
.place-text {
  margin: 1rem 0 1rem;
}
.place-one {
  min-height: 100%;
  padding-bottom: 0.4rem;
  box-shadow: 0px 3px 1.5px 0px #ccc;
  border-radius: 5%;
  overflow: hidden;
}
.place img {
  height: 12.5rem;
}
.place-date {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}
.name-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0 0.2rem;
  padding: 0 0.6rem 0;
}
.name {
  font-size: 1.1rem;
  font-weight: 550;
}
.price {
  font-size: 1rem;
}
.a-address {
  height: 1rem;
  margin: 0 0 0.4rem 0;
  padding: 0 0.6rem 0;
}
.address {
  float: left;
  color: #bfbfbf;
  font-size: 0.9rem;
}
.address span {
  margin-left: 0.6rem;
}
.evening {
  float: right;
  font-size: 0.9rem;
}
.place-bottom {
  padding: 0 0.6rem 0;
}
.star {
  float: left;
}
.comments {
  float: left;
  font-size: 0.9rem;
  line-height: 0.89rem;
  margin-left: 0.4rem;
}
.like {
  min-height: 21vh;
  box-shadow: 0px 2px 1.5px 0px #ccc;
  border-radius: 1rem;
  overflow: hidden;
  margin: 1rem 0 1rem;
}
.pic {
  float: left;
  width: 42%;
  height: 21vh;
}
.pic img {
  float: left;
  width: 100%;
  height: 100%;
}
.like-text {
  height: 20vh;
  margin-left:44% ;
  margin-right:.4rem ;
  margin-top: .4rem;
}
.like-name{
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: .2rem;
}
.like-address{
  color: #bfbfbf;
  font-size: 0.9rem;
  margin-bottom: 3rem;
}
.like-price {
  font-size: 1rem;
  float: right;
}
.like-address-t{
  min-height: 3vh;
}
.like-bottom{
  height: 1.6rem;
}
.star{
  float: left;
  margin-top: .2rem;
}
</style>
